/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.weso.acota.dao;

import del.icio.us.Delicious;
import del.icio.us.beans.Tag;
import java.util.LinkedList;
import java.util.List;
import org.weso.acota.to.RequestSuggestionTO;
import org.weso.acota.to.SuggestionTO;
import org.weso.acota.to.TagTO;

/**
 *
 * @author chema
 */
public class DeliciousSuggestDAOImpl implements SuggestDAO {

    @Override
    public SuggestionTO suggest(RequestSuggestionTO request) {
        SuggestionTO suggestion = new SuggestionTO();
        del.icio.us.Delicious del = new Delicious("", "");
        List ts = del.getTags();
        List<TagTO> tags = new LinkedList<TagTO>();
        int i = 0;
        while (i++<ts.size()){
            Tag t = (Tag) ts.get(i);
            tags.add(new TagTO(DeliciousSuggestDAOImpl.class.getSimpleName(), t.getTag()));

        }
        suggestion.setTags(tags);
        return suggestion;


    }
}
